home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / uasmlst.arc / UASMLST.DOC next >
Text File  |  1984-03-18  |  3KB  |  67 lines

  1.                            Uasmlst
  2.  
  3.      Ever  use  DEBUG to dis-assemble a file and sit  around  for 
  4. hours  doing  a simetaneous dump to the printer,  all  the  while 
  5. wishing you could put it in a file instead,  and them get down to 
  6. actually  editing  the source code and re-assemblying,  with  you 
  7. changes? Pipes and filters are the answer.
  8.  
  9.      The  DOS manual says pipes "allow the screen output  of  one 
  10. program   to   be   used  as  the  keyboard  input   to   another 
  11. program....and piping is the chaining of programs with  automatic 
  12. redirection of standard input and output." 
  13.  
  14.      Well,  exactly what is standard input and  output?  Keyboard 
  15. and screen, respectively. The redirection of standard output is a 
  16. cinch,  just  tell  DOS  to  send  the output  to  a  disk  file. 
  17. Unfortunately,  this kills the standard output to the screen,  so 
  18. you don't know what you are doing. Working in the dark, you might 
  19. say.  This is where the use of input redirection comes into play, 
  20. why not create a script of debug commands,  use that as  standard 
  21. input  and kick back and let the script do all the work.  This is 
  22. how it can be done for creating a debug dis-assembly file.
  23.  
  24. A>DEBUG
  25. -F CS:0100 L1000 "0"   <=== Fills 1,000 bytes with hex "F"
  26. -Q
  27. A>DEBUG MYFILE.COM     <=== Load the file to be dis-assembled
  28. -D                     <=== Dump  the  file,   note   addresses 
  29.                             containing data, continue Dumping
  30.                             until you reach the end of the file
  31.                             (section when contains contigious 
  32.                             FFFFFF's).
  33. -Q                     <=== Quit debug
  34. A>Copy con infile
  35. U addr1  addr2         <=== Start and stop address
  36. U addr3  addr4         <=== Start and stop address
  37. etc.                   <=== Until all code addresses are specified
  38. q                      <=== Tell debug to Quit
  39. Ctrl Z                 <=== End of file mark
  40.  
  41. A>DEBUG MYFILE.COM <INFILE >OUTFILE
  42.  
  43.      Think of the pipes as funnels.  In this case INFILE will  be 
  44. used  in lieu of keyboard input to debug.  All output that  would 
  45. normally  be  sent to the screen will be piped to a  file  called 
  46. OUTFILE.  Of  course,  the names of these files can be changed to 
  47. any filename that you would like to use.
  48.  
  49.      You've  now  created  a  file  which  is  identical  to  the 
  50. unassembly that you would normally see on your screen.  Edit  the 
  51. file  to  remove  your  script  commands and  submit  it  to  the 
  52. UASMLST.EXE  program (which is contained on the  current  library 
  53. disk).  The  program  will  then ask for the  input  file.  Enter 
  54. OUTFILE.  When  asked  for  the  output file  name  enter  a  new 
  55. filename,  usually with a .ASM extension.  The program will  then 
  56. read OUTFILE,  eliminate the hex addresses on the left and assign 
  57. labels  (in  the form Ln,  where n = 1 - 999) for all  jumps  and 
  58. calls, and send the results to the new file
  59.  
  60.      If  you  get an error message "Error:  Referenced  code  not 
  61. found:",  it means that a jump or call was found which referenced 
  62. an  address  not found in the input file.  This means you  missed 
  63. portions of the code, you started unassembling in the middle   of 
  64. an instruction,  you got into data areas,  or (possibly) the code 
  65. modifies itself during execution./g in the middle   of 
  66. an instruction,  you got into data areas,  or (possibly) the code 
  67.